The present invention relates to a method and apparatus for managing color data which is used for processing of color data which is necessary for display a color display, color printing by a printer, or the like and, more particularly, to a method and apparatus for managing color data in which a small number of color data to be used in actual processes is registered into a pallet table from among a number of color data of a color space which is constructed by a plurality of components of RGB or the like and the color data is expressed and processed by an entry number of a table whose data length is short.
When a color is expressed on a computer, it is a general way to express a color in color spaces such as RGB space which is expressed by a combination of R, G, and B components as three attributes of a color, color space which is expressed by a combination of C, M, Y, and K components which are obtained by converting the RGB space into data for printing, further, CIE L*a*b* space which is expressed by a combination of L*, a*, and b* components which are obtained by converting the RGB space by numerical arithmetic operations and coincide with human eyesight characteristics, CIE L*u*v* space which is expressed by a combination of L*, u*, and v* components, or the like.
In case of the RGB space, for example, the number of bits as expressing means of an information amount is allocated to three variables of R, G, and B in correspondence to the necessary number of expressing colors. For instance, assuming that 4096 colors are needed, 4 bits are allocated to each variable, thereby enabling 16 stages to be expressed. Since there are 3 variables, expressing means of 16.sup.3 =4096 kinds is used.
On the other hand, in an output apparatus such as a display apparatus, printing apparatus, or the like, in order to enable a number of colors to be simultaneously output, a large amount of resources such as memory devices, output devices, and the like are needed and an apparatus of a high speed and high function is needed, thereby causing an increase in costs. Therefore, by using a pallet converting mechanism having a structure such that the number of colors which can be simultaneously output is limited to, for example, 16 colors and these 16 colors are not fixed but can be arbitrarily selected from 4096 colors, a variety of colors can be expressed although they are limited.
FIG. 1 shows a method for managing color data using a conventional pallet converting mechanism and shows, as an example, a case where 16 colors are arbitrarily selected from 4096 colors and expressed. A table which has, for example, eight entries of 0 to 7 and can store RGB data of 12 bits (4 bits.times.3) is prepared as a pallet management table. When data is processed, transmitted, converted, or the like, RGB data up to 16 colors is arbitrarily selected from 4096 colors and registered into the pallet management table. With respect to the data processing, transfer, conversion, or the like, RGB data having a construction of 12 bits is not used but an entry number of 3 bits indicative of the RGB data registered in the pallet management table is used. When data is actually output to a color display, a printer, or the like, the data is reconstructed to the original RGB data by using the pallet management table. By the method of managing color data using such a pallet structure as mentioned above, the processing amount for color data is reduced and the reduction of memory capacity and high speed and high efficiency of processes can be realized.
However, in the conventional color data managing method using such a pallet converting mechanism, which kind of RGB data has actually been registered into the pallet management table for the entry number can be known only by actually retrieving the table and there is the following problems. For instance, in case of a new registration, it is necessary to read out the contents in the table with respect to all of the entry numbers, to confirm space entries, and to execute a registering process. In case of updating the registration, it is necessary to read out the contents in the table with respect to all of the entry numbers, to compare with the RGB data to be updated, to judge the presence or absence of the same contents, and to execute a rewriting process of the contents in the table according to the result of the judgment. Therefore, in order to newly register or update one entry, accessing of all entries is needed and it takes a long time for the registration updating process of the contents in the table.
Explanation will now be made specifically with reference to FIG. 1. It is now assumed that the RGB data has already been registered in seven entries of the entry number 0 to 6 in the pallet management table having eight entries of the entry numbers 0 to 7. In this case, the RGB in which each data of R, G, and B has values of 0 to 15 is valid as data. Therefore, the entry number 7 in which the data value of 16 which is invalid as each data value of R, G, and B has been registered can be recognized as an unregistered entry. When the RGB data "White" is newly registered in this situation, all of the entry numbers 0 to 7 are first retrieved, thereby detecting an unregistered area. Since the entry number 7 is not registered yet here, the RGB data of "White" can be registered into the entry number 7. Subsequently, after the RGB data "White" was registered, when the RGB data "Pale red" is registered, an additional registration cannot be executed because there is no unregistered entry already. In such a case, in the color data managing method of the pallet converting mechanism, as a typical method, in many cases, by making the color to be registered correspond to the entry number of the color that is nearest to such a registration color, such a color is replaced by a "Likelihood color" although the color which is expressed differs.
In FIG. 1, when "Pale red" whose RGB data is constructed by `13, 0, 0` is registered, all of the entries are first retrieved, thereby recognizing that there is no unregistered region. Subsequently, all of the entries are retrieved again and the entry number 3 "Red" whose RGB data is constructed by `15, 0, 0` and which gives a color that is nearest to "Pale red" is extracted and the RGB data "Pale red" is registered into the entry number 3. In this case, it is necessary to execute the retrieval of all entries two times. In the conventional color data managing method using the pallet structure as mentioned above, there is a problem such that it takes a long time for the accessing of all entries at the time of the new registration or the change of the registration.